#include <my_header.h>

/* Usage: ./6_sigaction_SA_RESETHAND */
void func(int sig_value){
    printf("before: sig_value %d \n", sig_value);
}
int main(void)
{
    struct sigaction act, old;
    memset(&act, 0, sizeof(act));
    act.sa_handler = func;
    // `SA_RESETHAND`: 处理完捕获的信号以后，信号处
    // 理回归到默认( 一次注册只生效一次)
    act.sa_flags = SA_RESETHAND;

    sigaction(SIGINT, &act, &old);

    while(1);
    return 0;
}

